//package com.zbkj.admin.controller;
//
//import cn.hutool.json.JSONObject;
//import com.alibaba.fastjson.JSON;
//import com.zbkj.admin.boot.redisson.command.Redis;
//import com.zbkj.admin.service.WechatService;
//import com.zbkj.admin.vo.WeChatOauthToken;
//import lombok.RequiredArgsConstructor;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestParam;
//
//import java.net.URLDecoder;
//import java.nio.charset.StandardCharsets;
//
//@Controller
//@RequiredArgsConstructor
//public class WeChatCallbackController {
//
//    private final WechatService wechatService;
//    private final Redis redis;
//
//    public void callCode(@RequestParam("code") String code,@RequestParam("state") String stateParam){
//        // 1. 解码state参数
//        String decodedParam = URLDecoder.decode(stateParam, StandardCharsets.UTF_8);
//        JSON.parseObject(decodedParam, JSONObject.class);
//        // 2. 使用code换取access_token
//        WeChatOauthToken token = wechatService.getOauth2AccessToken(code);
////        redis
//    }
//
//
//}
